//function setCookie(){
//	
//}
//function getCookie(){
//	
//}
//
//function removeCookie(){
//	
//}

var Cookie = {
	setCookie: function(name, value, day, path) {
		var now = new Date();
		now.setDate(now.getDate() + day)

		console.log(value)
		value = encodeURIComponent(value);
		console.log(value)

		if(path) {
			var cookie = name + '=' + value + ';expires=' + now + ';path=' + path;
		} else {
			var cookie = name + '=' + value + ';expires=' + now;
		}

		document.cookie = cookie;
	},
	getCookie: function(name) {
		//解码
		cookie = decodeURIComponent(document.cookie);
		var arr = cookie.split("; ");
		for(var i = 0; i < arr.length; i++) {
			var arr2 = arr[i].split("=");
			if(arr2[0] == name) {
				return arr2[1];
			}
		}
		
		
	},
	removeCookie: function(name) {
		this.setCookie(name,'',-100)
	}
}

//cookie.getCookie()